home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / xeno / megacd.lha / megacd / MegaCDOnline.rexx < prev    next >
OS/2 REXX Batch file  |  1995-10-01  |  4KB  |  139 lines

  1. /*************************************************/
  2. /*                                               */
  3. /*   MegaCDOnline.rexx v1.01 ⌐ David Huckett..    */
  4. /*    Xenolink 1.95 CD-Rom Door. loaded util     */
  5. /*   By David Huckett  14-Jun-95 3:640/800 Fido  */
  6. /*************************************************/
  7.  
  8. /*  WARNING  CD-ROMs that have no name and show up on Workbench as Unnamed
  9. **           must only be used one at a time.. You can not have three volumes
  10. **           loaded in drives all called Unnamed.. It will confuse the door.
  11. */
  12.  
  13. /*  INSTRUCTIONS
  14. **
  15. **   This is a small support util hacked from the main MegaCD.rexx
  16. **   program..
  17. **   What it is used for is to display to users as they log in, what
  18. **   CD-Rom disks are loaded at the time...
  19. **   It can be placed in you FakeMain.menu so that all users as they
  20. **   Login, will get to see it..
  21. **
  22. **   Setup as a REXX "Doors:MegaCD/MegaCDOnline.rexx ~14" in you .src
  23. **
  24. **   Only a few options.. One will display ALL available CDs' with the
  25. **   ones online at the time highlighted or it will just display the online
  26. **   ones..
  27. **   To display only loaded CDs' then leave ONLINEONLY = 'Y'
  28. **   else to show all configured Cds' with the online ones highlighted
  29. **   set ONLINEONLY = 'N'
  30. **
  31. */
  32.  
  33. CDCFG      = 'Doors:MegaCD/CD.cfg'
  34. BBSNAME    = 'MegaTech BBS'
  35. ONLINEONLY = 'Y'
  36.  
  37. VERS = 'MegaCDOnline v1.01'
  38. options results
  39.  
  40. PR = 'PRINT'
  41.  
  42. arg Node_Number
  43. host = 'XenolinkRexxPort'Node_Number
  44. address value host
  45. signal on error
  46. signal on syntax
  47. signal on IOERR
  48.  
  49.  if ~show('L','rexxsupport.library') then do
  50.   if ~addlib('rexxsupport.library',0,-30,0) then do
  51.     PR 'Support library not available.'
  52.      call error
  53.     signal Quit
  54.    end
  55. end
  56.  
  57. getuservar privilege ; access = result
  58. GETUSERVAR MENUSET 
  59. gfx=result         
  60. if gfx >='1' then do
  61.     WHI='';RED='';GRN='';BGRN=''
  62.         YEL='';BYEL='';BLU='';MAJ=''
  63.         CYA='';BCYA='';OFF=''
  64. END
  65.     ELSE DO
  66.     WHI='';RED='';GRN='';BGRN='';YEL='';BYEL='';BLU='';MAJ=''
  67.         CYA='';OFF='';BCYA=''
  68. END
  69.  
  70. CALL PRAGMA('W','N')  /* Disk Requesters OFF */
  71.  
  72. START:
  73. CLS
  74. pr BLU'                 ┌───────────────────────────────────┐'
  75. pr '                 │'BGRN||Centre(bbsname' CD-Rom Doorway',34)||OFF||BLU' │'
  76. pr '                 │                                   │'
  77. pr '                 │'BCYA'  Presently loaded CD-Rom Disks..'OFF||BLU'  │'
  78. pr '                 │                                   │'
  79. pr '                 └───────────────────────────────────┘'OFF
  80. pr
  81.     if ~exists(CDcfg) then do
  82.     PR ' Sorry config file not found.. Advise Sysop.'
  83.     call ERROR
  84. end
  85.     else do
  86.     Call open(cfg,CDcfg,'R')
  87.         numcd=readln(cfg)
  88.         do i=1 to numcd
  89.     lock.i=readln(cfg)
  90.     title.i=readln(cfg)
  91.     config.i=readln(cfg)
  92.     desc.i=readln(cfg)
  93.     noacclevel.i=readln(cfg)
  94.     noviewlev.i=readln(cfg)
  95.  
  96. if index(noacclevel.i,access) ~=0 then existnoacc.i = 'No Access'
  97. existnoview = index(noviewlev.i,access)  /* See if you have given access to their level */
  98. if existnoview ~= 0 then do  /* Check to see if the user has view access */
  99. title.i = 'No View'          /* eg GIF CD's, if not then flag this one out */ 
  100. iterate i
  101. end
  102.  
  103. if  ~Exists(lock.i) then do
  104.     if onlineonly = 'Y' then iterate i
  105.         pr YEL||left(i'.',4)CYA||left(title.i,15)RED||left('OFFLINE',8)OFF||left(desc.i,45)
  106.         title.i='Not Online'        /* If the system can't get a lock on the volume */
  107.         iterate i                   /* then flag it offline */
  108.     end
  109.     pr BCYA||left(i'.',4)BYEL||left(title.i,15)GRN||left('Online',8)CYA||left(desc.i,45)OFF
  110.        end
  111.     call close(cfg)
  112. END
  113.  
  114.  
  115. pr
  116. msg ' Any key to continue. '
  117. getchar
  118. Exit 0
  119.  
  120.  
  121. /*************** ERROR Routine *******************/
  122. error:
  123. a = SIGL;message 'Error!!!  Line # 'a;call delay 200
  124. SysopLog 'ERROR MegaCDonline line # 'a
  125.  
  126.  
  127. EXIT 10
  128.  
  129. syntax:
  130. a = SIGL;message 'Syntax Error!!!  Line # 'a;call delay 200
  131. SysopLog 'SYNTAX ERROR MegaCDonline line # 'a
  132. EXIT 10
  133.  
  134. ioerr:
  135. message 'I/O Error!!!';call delay 200
  136. SysopLog 'IO ERROR MegaCDonline.'
  137.  
  138. EXIT 10
  139.